﻿using System;
using Macds.Test.Core.ServiceLocator.Mocks;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Macds.Test.Core.ServiceLocator
{
    [TestClass]
    public class DependencyFactoryTest
    {
        [TestMethod]
        public void CreateServiceTest()
        {
            var dependency = new DependencyFactory();
            ICustomerService customerService = dependency.CreateService<ICustomerService>("CustomerService");
            ICustomerRepository customerRepository = dependency.CreateService<ICustomerRepository>("CustomerRepository");

            Assert.AreEqual(1, customerRepository.GetCustomerID("customer1"));
            Assert.AreEqual(1, customerService.GetCustomerID("customer1"));
        }
    }
}
